home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PPC1B3AA.ZIP / MENU.PPS < prev    next >
Text File  |  1996-08-29  |  2KB  |  87 lines

  1. ;----------------------------------------------------------------------------
  2. ; Copyright(C) 1996, The AEGiS Corporation
  3. ;----------------------------------------------------------------------------
  4. ;
  5. ; FUNCTION Menu()
  6. ;
  7. ; Full featured lightbar menu function!
  8. ; Returns the item selected
  9. ;
  10. ;----------------------------------------------------------------------------
  11. #lib
  12. #nouser
  13.  
  14. Declare Function Menu(String PageName, Int FirstLine, Int nLines, Int DefaultLine) Integer
  15. Declare Procedure Menu_DispSelected(Integer Seln)
  16. Declare Procedure Menu_RemoveSelected(Integer Seln)
  17. Declare Procedure Menu_RemCursor()
  18.  
  19. String Menu_Key, Menu_BackupLightbar
  20. Int Menu_FirstLine
  21.  
  22. ;----------------------------------------------------------------------------
  23. Function Menu(String PageName, Int Firstline, Int nLines, Int DefaultLine) Integer
  24.  
  25. Int Sel
  26. Sel = DefaultLine
  27.  
  28. Menu_FirstLine = FirstLine
  29.  
  30. Color @X0F
  31. Cls
  32. StartDisp FNS
  33. DispFile PPEPath() + PageName, Graph + Lang
  34.  
  35. Menu_DispSelected(Sel)
  36.  
  37. While (1) Do
  38.     Menu_Key = Inkey()
  39.     If (Menu_Key <> "") Then
  40.         Select case Menu_Key
  41.             Case "DOWN", "2","5"
  42.                 Menu_RemoveSelected(Sel)
  43.                 Sel = Sel + 1
  44.                 If (Sel = nLines + 1) Sel = 1
  45.                 Menu_DispSelected(Sel)
  46.             Case "UP","8"
  47.                 Menu_RemoveSelected(Sel)
  48.                 Sel = Sel - 1
  49.                 If (Sel = 0) Sel = nLines
  50.                 Menu_DispSelected(Sel)
  51.             Case Chr(13)
  52.                 Menu = Sel
  53.                 Break
  54.             Case Chr(27)
  55.                 Menu = 0
  56.                 Break
  57.         End Select
  58.     EndIf
  59. EndWhile
  60.  
  61. Endfunc
  62.  
  63. ;----------------------------------------------------------------------------
  64. Procedure Menu_DispSelected(Integer Seln)
  65. AnsiPos 22,Menu_FirstLine+Seln-1
  66. Menu_BackupLightbar = ScrText(22,Menu_FirstLine+Seln-1,36,True)
  67. Print "@X1F",ScrText(22,Menu_FirstLine+Seln-1,36,False)
  68. Menu_RemCursor()
  69. Endproc
  70.  
  71. ;----------------------------------------------------------------------------
  72. Procedure Menu_RemoveSelected(Integer Seln)
  73. AnsiPos 22,Menu_FirstLine+Seln-1
  74. Print "@X0F",Menu_BackupLightbar
  75. Menu_RemCursor()
  76. Endproc
  77.  
  78. ;----------------------------------------------------------------------------
  79. Procedure Menu_RemCursor()
  80. AnsiPos 1,22
  81. Color 0
  82. Print " "
  83. Backup 1
  84. EndProc
  85.  
  86.  
  87.